<?php
/**
 * Created by JetBrains PhpStorm.
 * User: 蒋文书
 * Date: 14-12-27
 * Time: 下午8:50
 * To change this template use File | Settings | File Templates.
 */

namespace Home\Model;
use Think\Model;

class MessageModel extends Model {
    
    protected $_auto = array(
        array('create_time', NOW_TIME, self::MODEL_INSERT),
        array('update_time', NOW_TIME, self::MODEL_BOTH),
    );

    /**
     * 新增新闻
     * @return 
     * @author 蒋文书 <jiangwenshu1990@126.com>
     */
    public function addInfo(){     
        //创建数据对象
        $data = $this->create();
        if(!$data){
            $this->error='创建数据对象错误!';
        }
        return $this->add($data);
    }
}
 